Repository navigation
Inbox: 👍 Looks good is sent through to the agent - #1980
Merged
Merged
Conversation
After the Undo window the Inbox writes a note (a person's message with ack_of) that the existing reply delivery hands to the session that wrote the message, exactly once: a waking connection gets one short turn naming the message, an MCP-only agent gets wait_for_reply's acknowledged. The note is never listed in the thread; the line under the message says pending, queued or saved, then Delivered to <agent>.
At settle, re-check ackMessage's conditions: a person reply or a newer agent message after the acknowledged message settles the ack as not_sent (replied / wrote_again) with no note, and no agent sees it. The line says why. The mobile contract says a phone never displays a message with ack_of. markAcksSeen's JSDoc back in place.
…ot sent Server tests for the stored and live wait paths, after a reply and after the agent wrote again inside the Undo window.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The owner, on the Inbox's 👍 Looks good: "I replied with looks good, but I realized that doesn't send through. I think we just need to send looks good through, honestly."
Until now 👍 was silent: it stored an
ackon the agent's message and marked the thread read. An agent saw it only when it next called read_thread or wait_for_reply. With this change, the 👍 reaches the agent that wrote the message once the same 10 s Undo window has passed. The toast's Undo (orZ) still takes it back before anything is sent.Design: a note, delivered like a reply
When the window passes,
settleAckswrites two lines:settled_seq/settled_atand the newnote_id.note_idnames: a person's message withack_of: <message id>,reply_toset to that message, and bodyinboxAckLine(<message id>).The note goes through the existing reply machinery, so exactly-once delivery comes from the claim, lease and
deliveredevent we already have. Nothing new on the connection side:replyand addsack_of. Withack_of,inboxWakeTextproduces:inboxAckLinein the connection contract, and the mod has a byte-for-byte copy. An older connection words the command as a plain reply, with that same line as the person's words.wait_for_replykeeps itsacknowledgedresult. That result now records the note's delivery, so a connection never hands the agent the same 👍 again. A delivery through the wake also marks the ack seen, so a later wait across all threads is not answered by it either.isInboxNotenow matchesack_of. The list'ssentandunseen, the look, "came back" andreadAtall read past it, so the thread stays read.thread()leaves it out, which keeps it out of the window, read_thread and the row's count andlast_at.ackNoteLive). A new 👍 later writes a new note.ackMessage's conditions. If the person sent a real reply after the message, or the agent wrote again, the ack settles withnot_sent: "replied" | "wrote_again". No note is written and no agent ever sees it (read_thread,wait_for_reply, the wake). The line under the message says "👍 Looks good · not sent: you replied" or "… not sent: wrote again".note_id, was never sent, and is not sent now.Downgrade
An older Inbox (before this PR) opening a store that holds notes reads a note as an ordinary person reply:
Acks settled with
not_sentwrite no note, so they behave as an older silent ack. The phone contract (adr/implementation/inbox-mobile.md, 7.56) now says a phone never displays a message withack_of. The relay and the event stream send every line, so a phone that builds threads from lines must drop it.The window
The line under the message (
AckPill/ackPillLine) now moves through these states:ack.delivered_at.The wording follows the reply delivery line in #1968, but this PR does not depend on #1968. The toast now reads "Moves to Quiet · goes to unless you undo". Mark read, the row's "👍 Looks good", the layout and every refusal are unchanged. No new keyboard shortcuts.
Docs
plannotator inbox --help("Where replies go").inbox-default-tools.ts.Tests
packages/shared/inbox/store-ack-delivery.test.ts(new; it also covers a reply and a newer agent message inside the window, both settled as not sent):packages/server/inbox-ack.test.ts:acknowledgedcounts as the deliveryInboxWakewith stand-in targets: one turn, then acknowledgedwait_for_replykeeps waitingapps/hook/hooks/mod/inbox.test.ts12: the mod against a real Inbox. One turn arrives after the window with the exact text, and the window shows Delivered.packages/inbox/ack.test.tsx: every line state, both not-sent lines included, and settled → saved → delivered over a real Inbox. The DOM server takesINBOX_DOM_SET_ASIDE_MSand adeliverstdin command.tests/e2e/inbox-ack.spec.tson the compiled binary:Local results:
bun run typecheck: clean.bun test packages/server packages/shared packages/core tests apps/hook/hooks/mod: 4374 pass, 0 fail.inbox-ack.spec.ts: 6/6 pass.